package org.linys.service.dict;

import java.util.List;

import org.linys.dao.dict.CityDAO;
import org.linys.model.dict.City;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CityServ {
	private CityDAO cityDAO;

	public CityDAO getCityDAO() {
		return cityDAO;
	}
	@Autowired
	public void setCityDAO(CityDAO cityDAO) {
		this.cityDAO = cityDAO;
	}
	
	
	public City selectTreeRoot() {
		return cityDAO.selectTreeRoot();
	}
	
	@SuppressWarnings("unchecked")
	public List<City> selectTreeNode(City city) {
		return cityDAO.selectTreeNode(city);
	}
	public List<City> getTreeNodeTabel(City city, Integer start,
			Integer rows) {
		return cityDAO.getTreeNodeTabel(city,start,rows);
	}
	public int save(City city) {
		return cityDAO.save(city);
	}
	public int insertValdate(City city) {
		System.out.println(cityDAO);
		return cityDAO.insertValdate(city);
	}
	public int deleteByCityID(Integer cityID) {
		return cityDAO.deleteByCityID(cityID);
	}
	public int count(City city) {
		return cityDAO.count(city);
	}
	public int countChoose(City city) {
		return cityDAO.countChoose(city);
	}
	public List<City> viewChoose(City city, Integer start, Integer rows) {
		return cityDAO.viewChoose(city,start,rows);
	}
	public int update(City city) {
		return cityDAO.update(city);
	}
	
	
}
